<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="/global/jsp-header.jsp"%>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<title>新增数据范围</title>
		<%@ include file="/global/html-header.jsp"%>
		<script>
	$(function() {
		$('.myform').idealforms();
		common.validator("actionrangeform");
		//添加数据范围
		$("#actionrangeform").submit(function(){
			var param=$(this).serialize();
			var canSubmit=common.checkBlankValue(param,new Array("actionRange.rangeName","actionRange.orderNo"));
			if(canSubmit){
				$.ajax({   
	        		type: "POST",  
	        		url: "${action }",  
	        		data: param, 
	        		success: function(msg){    
		        		window.parent.closeDialog();
		        		var alertMsg="";
	        			<c:if test="${addOperater}">
		        			if(msg=="success"){
	            				alertMsg="数据范围添加成功！";
	            				$(window.parent.document).find("#myform").submit();
	            			}else{
	            				alertMsg="数据范围添加失败！";
	            			}
	        			</c:if>
	        			<c:if test="${updateOperater}">
		        			if(msg=="success"){
		        				$(window.parent.document).find("#myform").submit();
    	                    	alertMsg="数据范围更新成功！";
	            			}else if(msg=="nochange"){
	            				alertMsg="数据范围属性没有改变！";
	            			}else{
	            				alertMsg="数据范围更新失败！";
	            			}
        				</c:if>
        				window.parent.editActionRangeTip(alertMsg);
	        		} 
	        	});
			}
			return false;
		});
	});
</script>
	</head>
	<body>
		<form action="${action }" name="actionrangeform" class="myform"
			id="actionrangeform" method="post">
		<input type="hidden" name="actionRange.rangeId" value="${actionRange.rangeId }"/>
		<div>
			<label class="required">
				数据范围名称:
			</label>
			<input type="text" size="40" name="actionRange.rangeName" class="{required:true,messages:{required:'请输入数据范围名称'}}"  value="${actionRange.rangeName }"/>
		</div>
		<div>
			<label class="required">
				数据范围排序值:
			</label>
			<input type="text" size="40" name="actionRange.orderNo"
				class="{required:true,digits:true,messages:{required:'请输入数据范围排序值'}}" value="${actionRange.orderNo }" />
		</div>
		<div>
			<label>
				&nbsp;
			</label>
			<input type="submit" value="${btnKeyWord }" />
		</div>
	</form>
	</body>
</html>